#include <iostream>
//
// Created by Asus on 2025/4/21.
//
class Calulator {
private:
    int value;

public:
    Calulator(int initValue = 0) : value(initValue) {
    }

    Calulator &add(int num) {
        this->value = this->value + num;
        return *this;
    }

    Calulator &sub(int num) {
        this->value = this->value - num;
        return *this;
    }

    int getValue() const {
        return this->value;
    }
};

int main() {
    Calulator calc(10);
    int result = calc.add(5).sub(3).getValue();
    std::cout << "Result: " << result << std::endl;
    return 0;
}
